home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 120
/
Vol 120.iso
/
games
/
battlefi.swf
/
scripts
/
frame_636
/
PlaceObject2_369_1329
/
CLIPACTIONRECORD onClipEvent(enterFrame).as
next >
Wrap
Text File
|
2010-11-09
|
2KB
|
72 lines
onClipEvent(enterFrame){
if(_root.vic)
{
this._y = 491.2;
}
if(_root.loss)
{
this._y = 491.2;
}
if(!this.hitTest(_root.castlerang))
{
this._x += speed;
}
if(duped && _root.population < _root.poptot)
{
_root.population = _root.population + 1;
_root.gold -= 150;
i++;
duplicateMovieClip(_root.arch,"MC2" + i,16384 + (100 + i));
_root["MC2" + i]._x = -6.399999999999999;
_root["MC2" + i]._y = random(50) + 201.7;
duped = false;
}
if(this.hitTest(_root.castlerang) && !attackin)
{
this.gotoAndPlay("attk");
attackin = true;
}
if(this.dead && this._currentframe < 41)
{
this.gotoAndPlay("die");
}
l = 1;
while(l < _root.lvl + 1)
{
if(this.hit.hitTest(_root["a" + l]))
{
this.gotoAndPlay("hurt");
remaining--;
attackin = false;
_root["a" + l].removeMovieClip();
}
l++;
}
if(this.dead)
{
this._x -= speed;
}
if(this.deadfull)
{
this._x = -1000000000;
}
f = 1;
while(f < Math.round(_root.lvl / 2 + 1))
{
if(this.hit.hitTest(_root.castle["th" + f]))
{
this.gotoAndPlay("hurt");
remaining--;
attackin = false;
_root.castle["th" + f].removeMovieClip();
}
f++;
}
if(remaining == 0)
{
this.gotoAndPlay("die");
remaining = 500;
}
this.hp._xscale = remaining / 2 * 100;
}